#!/bin/sh

CWD=`pwd`

testsdir=`ls -d libressl-*/_build/sub/tests`
if [ -d "$testsdir" ] ; then
	echo "##### test logs in $testsdir"
	cd $testsdir
	for i in `ls *.trs` ; do
		grep ':test-result: PASS' $i > /dev/null
		if [ $? -eq 1 ] ; then
			log=`echo $i | sed 's/\.trs$/\.log/'`
			echo "***** $log"
			cat $log
		fi
	done
	cd $CWD
fi
